
<Serializable()> Friend Class ConfigHolder

    'Private m_configs As ArrayList
    Private m_configss() As CarConfig = Nothing

    Friend Sub New()
        'm_configs = New ArrayList
    End Sub
    Friend Sub add(ByRef config As CarConfig)
        'm_configs.Add(config)
        If IsNothing(m_configss) Then
            ReDim m_configss(0)
            m_configss(0) = config
        Else
            ReDim Preserve m_configss(m_configss.Length)
            m_configss(m_configss.Length - 1) = config
        End If
    End Sub
    Friend Function getAsArray() As CarConfig()
        Return m_configss
    End Function
    Friend Function item(ByVal index As Integer) As CarConfig
        If Not IsNothing(m_configss) Then
            If index < m_configss.Length And index >= 0 Then
                Return m_configss(index)
            Else
                Return Nothing
            End If
        Else
            Return Nothing
        End If
    End Function
    Friend Function getList() As String()
        Dim f_str As String() = Nothing
        If Not IsNothing(m_configss) Then
            ReDim f_str(m_configss.Length - 1)
            For i As Integer = 0 To m_configss.Length - 1
                f_str(i) = m_configss(i).Series & ", " & m_configss(i).Engine
            Next
            Return f_str
        Else
            Return Nothing
        End If
    End Function
End Class
